﻿<local:DocumentBase x:Class="WPFExcelReport.YCAABAPP"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                    Height="700" Width="1024" 
                    FontSize="16"
                   Background="White"
                    Loaded="Window_Loaded"
                    Title="YCAABAPP"  
     >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetProd" />
        <CollectionViewSource   x:Key="vwLIEFDAT" Source="{Binding Path=LIEFDAT,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwFSSTAMM" Source="{Binding Path=FSSTAMM,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwABKOPF" Source="{Binding Path=ICC_ABKOPF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwABPOS_MAT" Source="{Binding Path=ICC_ABPOS_MAT,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwMDECKMAT" Source="{Binding Path=ICC_MDECKMAT,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwWDECKMAT" Source="{Binding Path=ICC_WDECKMAT,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwFDECKMAT" Source="{Binding Path=ICC_FDECKMAT,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwGAAUFMAT" Source="{Binding Path=ICC_GAAUFMAT,Source={StaticResource SetProd}}" />
    </local:DocumentBase.Resources>
    <Grid   >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1.5*"/>
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel>
                <Button Name="btnGetTask"  Margin="20,0,0,0" Width="40" Height="40"  Click="btnGetTask_Click">
                    <Button.Background>
                        <ImageBrush  ImageSource="Image/Reload.png" />
                    </Button.Background>
                </Button>
                <ComboBox Name="cmbStatus" Text="89" Width="60">
                    <ComboBoxItem Content="* "/>
                    <ComboBoxItem Content="RUN"/>
                    <ComboBoxItem Content="89"/>
                    <ComboBoxItem Content="99"/>
                </ComboBox>
                <TextBlock VerticalAlignment="Center">开始审批</TextBlock>
                <CheckBox IsChecked="False" Name="IsStartApproval" Background="Yellow" VerticalAlignment="Center" Checked="IsStartApproval_Checked" >
                    <CheckBox.LayoutTransform>
                        <ScaleTransform ScaleX="2" ScaleY="2" />
                    </CheckBox.LayoutTransform>
                </CheckBox>
                <Button Name="btnApprove" Width="40" Height="40" Margin="20,0,0,0" Click="btnApprove_Click">
                    <Button.Background>
                        <ImageBrush  ImageSource="image/button_ok.png" />
                    </Button.Background>
                </Button>
                <WrapPanel>
                    <Button FontSize="18" Height="40" Width="40" Margin="20,0,0,0" Name="butGetData" Click="btnQuery_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="image/Find.png" />
                        </Button.Background>
                    </Button>
                    <ComboBox
                    Name="cbWTYE"
                    HorizontalAlignment="Left"
                    IsEditable="True"
                    Background="White"
                    IsTextSearchEnabled="True"
                    IsTextSearchCaseSensitive="False"                           
                    Width="100" 
                    >
                        <ComboBoxItem Content="成衣款式"/>
                        <ComboBoxItem Content="面料"/>
                        <ComboBoxItem Content="辅料"/>
                        <ComboBoxItem Content="高级辅料"/>
                    </ComboBox>
                    <TextBlock FontSize="18"   Width="59"  Margin="0,0,0,0" Text="款式" />
                    <TextBox Background="Yellow"  FontSize="18"    Width="180" Name="txtFSART" CharacterCasing="Upper" Margin="10,0,0,0" Text="" />
                    <ComboBox
                            Name="cbFSSTAMM"
                              HorizontalAlignment="Left"
                              IsEditable="True"
                              IsTextSearchEnabled="True"
                              IsTextSearchCaseSensitive="False"
                              SelectionChanged="cbFSART_SelecteionChanged"
                              Width="200"
                              DisplayMemberPath="FSABEZ"
                              SelectedValuePath="FSART"                     
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwFSSTAMM}}"
                              >
                    </ComboBox>
                    <Button Content="打印"  FontSize="18" Height="40" Margin="20,0,0,0"  Name="btnPrint" Width="Auto" Click="btnPrint_Click"/>
                </WrapPanel>
            </WrapPanel>
     
            <WrapPanel>
                <Button FontSize="18" Height="40" Width="40" Margin="20,0,0,0" Name="btnUpdateIntex" Click="btnUpdateIntex_Click">
                    <Button.Background>
                        <ImageBrush  ImageSource="Image/Upload.png" />
                    </Button.Background>
                </Button>
                <TextBlock FontSize="18" Margin="00,0,0,0" >刷新</TextBlock>
                <TextBlock FontSize="18" Margin="15,0,0,0" >交期</TextBlock>
                <TextBox Background="White"  FontSize="18"   Margin="1,0,0,0"  Width="100" Height="30" VerticalAlignment="Top" Text="{Binding ABKLIEFDAT, Source={ StaticResource ResourceKey=vwABKOPF}}" CharacterCasing="Upper" />
                <TextBlock FontSize="18" Margin="15,0,0,0" >价格</TextBlock>
                <TextBox Background="White"  FontSize="18"   Margin="1,0,0,0"  Width="100" Height="30" VerticalAlignment="Top" Text="{Binding ARWERT, Source={ StaticResource ResourceKey=vwABKOPF}, Converter={StaticResource ResourceKey=d1000}}"/>
                <TextBlock FontSize="18" Text="外发厂"  Margin="10,0,0,0" />
                <ComboBox
                    Text="{Binding EXTFTYNAME, Converter={StaticResource ResourceKey=gb2312}, Source={ StaticResource ResourceKey=vwABKOPF}}"
                            Name="cbExtFact"
                              HorizontalAlignment="Left"
                              IsEditable="True"
                              IsTextSearchEnabled="True"
                              Height="30"
                                FontSize="14"
                              VerticalAlignment="Top" 
                              IsTextSearchCaseSensitive="False"
                              Width="300"
                              DisplayMemberPath="LSNAME1"
                              SelectedValuePath="LSLIEFNR"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwLIEFDAT}}"
                              >
                </ComboBox>
                <TextBox Background="Wheat"  FontSize="18"   Margin="15,0,0,0"  Width="40"  Height="30" VerticalAlignment="Top" Text="{Binding ABKAUFKRS, Source={ StaticResource ResourceKey=vwABKOPF}}" CharacterCasing="Upper" />
                <TextBox Background="Wheat"  FontSize="18"   Margin="15,0,0,0"  Width="80"  Height="30" VerticalAlignment="Top" Text="{Binding ABKAUFLFD, Source={ StaticResource ResourceKey=vwABKOPF}}" CharacterCasing="Upper" />
            </WrapPanel>
        </StackPanel> 
            <StackPanel Grid.Row="1" Grid.Column="0" >
                        <WrapPanel>
                       <TextBlock>待批复单</TextBlock>
                            <TextBlock Name="txtMessage" Width="300"></TextBlock>
                        </WrapPanel>
                        <DataGrid  x:Name="dlgAB04"
                               ItemsSource="{Binding Source={StaticResource ResourceKey=vwABKOPF}}"  
                               AutoGenerateColumns="False"
                               EnableRowVirtualization="False"
                               VerticalScrollBarVisibility="Auto"
                               HorizontalScrollBarVisibility="Auto"
                               VerticalAlignment="Stretch"
                               HeadersVisibility="Column" 
                               FontSize="14"
                               HorizontalAlignment="Stretch"
                               RowDetailsVisibilityMode="Visible">
                            <DataGrid.RowDetailsTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal" Margin="5">
                                        <TextBlock Foreground="CadetBlue" FontSize="16"                         
                            Text="{Binding Path=FSABEZ, Converter={StaticResource ResourceKey=gb2312}}"/>
                                    </StackPanel>
                                </DataTemplate>
                            </DataGrid.RowDetailsTemplate>
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding Path=ABKSPGRD}" Header="确认"   Width="40" />
                                <DataGridTextColumn Binding="{Binding Path=ABKGESSTA}" Header="状态"   Width="40" />
                                <DataGridTextColumn Binding="{Binding Path=ABKLIEFDAT}" Header="交期"   Width="40" />
                                <DataGridTextColumn Binding="{Binding Path=ABKAUFKRS}" Header="" Width="Auto" MinWidth="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABKAUFLFD}" Header="生产单" Width="Auto" MinWidth="60" />
                                <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="款式" Width="Auto" MinWidth="120" />
                                <DataGridTextColumn Binding="{Binding Path=EXTFTYNAME, Converter={StaticResource ResourceKey=gb2312}}" Header="外发厂" Width="120" MinWidth="60" />
                            </DataGrid.Columns>
                        </DataGrid>
                    </StackPanel> 
                    
                    <StackPanel Grid.Row="1" Grid.Column="1">
                        <WrapPanel>
                            <TextBlock>总件数:</TextBlock>
                            <TextBlock Name="txtTotal" Width="200"></TextBlock>
                            <TextBlock>尺码</TextBlock>
                        </WrapPanel>
                        <DataGrid 
                                CanUserReorderColumns="True"  
                                CanUserResizeRows="True" 
                                CanUserSortColumns="True"                  
                                AutoGenerateColumns="False"   
                                EnableRowVirtualization="False"  
                                HorizontalAlignment="Stretch" 
                                VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True"
                                CellEditEnding="MasterDataGrid_CellEditEnding"
                                ItemsSource="{Binding Source={StaticResource ResourceKey=vwABPOS_MAT}}"  
                                x:Name="SizeColorMatrixDataGrid" 
                                Margin="0,1,0,0" 
                                IsTextSearchCaseSensitive="True" 
                                RowDetailsVisibilityMode="Visible"
                                SelectionUnit="Cell">
                                <DataGrid.RowDetailsTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal" Margin="50,0,0,0" HorizontalAlignment="Right">
                                            <TextBlock Foreground="Black" FontSize="12" Text="意向量"/>
                                            <TextBlock Foreground="Black" FontSize="12" Text="{Binding Path=TQTYP}"/>
                                            <TextBlock Foreground="Green" Margin="10,0,0,0" FontSize="12" Text="S:"/>
                                            <TextBlock Foreground="Green" Margin="10,0,0,0" FontSize="12" Text="{Binding Path=SP}"/>
                                            <TextBlock Foreground="Red" Margin="10,0,0,0" FontSize="12" Text="M:"/>
                                            <TextBlock Foreground="Red" Margin="10,0,0,0"  FontSize="12" Text="{Binding Path=MP}"/>
                                            <TextBlock Foreground="Green" Margin="10,0,0,0"  FontSize="12" Text="L:"/>
                                            <TextBlock Foreground="Green" Margin="10,0,0,0"  FontSize="12" Text="{Binding Path=LP}"/>
                                            <TextBlock Foreground="Red" Margin="10,0,0,0"  FontSize="12" Text="XL:"/>
                                            <TextBlock Foreground="Red" Margin="10,0,0,0"  FontSize="12" Text="{Binding Path=XLP}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </DataGrid.RowDetailsTemplate>
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="颜色"   Width="60" />
                                    <DataGridTextColumn Binding="{Binding Path=TQTY}" Header="数量"   Width="80" />
                                    <DataGridTextColumn Binding="{Binding Path=S}" Header="S"   Width="60" >
                                    </DataGridTextColumn>
                                    <DataGridTextColumn Binding="{Binding Path=M}" Header="M"  Width="60" />
                                    <DataGridTextColumn Binding="{Binding Path=L}" Header="L"  Width="60" />
                                    <DataGridTextColumn Binding="{Binding Path=XL}" Header="XL"  Width="60" />
                                </DataGrid.Columns>
                            </DataGrid  >
                            <DataGrid CanUserReorderColumns="True"  
                                      CanUserResizeRows="True" CanUserSortColumns="True"                  
                                      AutoGenerateColumns="False"   
                                      EnableRowVirtualization="True"  
                                      RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                      IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                                      ItemsSource="{Binding Source={StaticResource ResourceKey=vwWDECKMAT}}"  x:Name="WDECKDataGrid" 
                                      CellEditEnding="WDECKDataGrid_CellEditEnding"
                                      SelectionUnit="Cell"
                                      Grid.ColumnSpan="4" Margin="0,1,0,0" Grid.Row="2"                   >
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=ART}" Header="面料"   Width="80" />
                                    <DataGridTextColumn Binding="{Binding Path=FARBE}" Header="颜色"   Width="60" />
                                    <DataGridTextColumn Binding="{Binding Path=TQTY, Converter={StaticResource ResourceKey=d100}}" Header="数量"   Width="120" />
                                </DataGrid.Columns>
                            </DataGrid  >
                            <DataGrid CanUserReorderColumns="True"  
                                      CanUserResizeRows="True" CanUserSortColumns="True"                  
                                      AutoGenerateColumns="False"   
                                      EnableRowVirtualization="True"  
                                      RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                      IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                                      ItemsSource="{Binding Source={StaticResource ResourceKey=vwMDECKMAT}}"  x:Name="MDECKDataGrid" 
                                      CellEditEnding="MDECKDataGrid_CellEditEnding"
                                      Grid.ColumnSpan="4" Margin="0,1,0,0" Grid.Row="2" SelectionUnit="Cell">
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=ART}" Header="辅料"   Width="120" />
                                    <DataGridTextColumn Binding="{Binding Path=TQTY, Converter={StaticResource ResourceKey=d100}}" Header="数量"   Width="120" />
                                </DataGrid.Columns>
                            </DataGrid  >
                            <DataGrid CanUserReorderColumns="True"  
                                      CanUserResizeRows="True" CanUserSortColumns="True"                  
                                      AutoGenerateColumns="False"     
                                      EnableRowVirtualization="True"  
                                      RowDetailsVisibilityMode="VisibleWhenSelected" 
                                      HorizontalAlignment="Stretch" 
                                      VerticalAlignment="Stretch"
                                      IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                                      ItemsSource="{Binding Source={StaticResource ResourceKey=vwFDECKMAT}}"  x:Name="GAAUFDataGrid" 
                                      CellEditEnding="FDECKDataGrid_CellEditEnding"
                                      Grid.ColumnSpan="4" Margin="0,1,0,0" Grid.Row="2" SelectionUnit="Cell">
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=ART}" Header="高级辅料"   Width="80" />
                                    <DataGridTextColumn Binding="{Binding Path=FARBE}" Header="颜色"   Width="40" />
                                    <DataGridTextColumn Binding="{Binding Path=SIZE}" Header="尺寸"   Width="80" />
                                    <DataGridTextColumn Binding="{Binding Path=TQTY}" Header="数量"   Width="120" />
                                </DataGrid.Columns>
                            </DataGrid  >
                        </StackPanel> 
       
    </Grid>
</local:DocumentBase>
